import React, { Component } from 'react';
import { Modal, Button } from 'antd';


import Desks from "./Desks"

interface IProps {
   open: any;
   sel:any
  //  areadesk:any;
    
   }
   

class Desk extends Component <IProps> {
    state = {
        modal1Visible: false,
      
      };
    //   const { open } = this.props;

    //  触发模态框的显示隐藏
  setModal1Visible(modal1Visible:any) {
    this.setState({ modal1Visible });
  }
//   component(){
//     console.log(22222);
//     console.log(this.props.open);
    
//     this.setModal1Visible(this.props.open)
    
//   }
    static getDerivedStateFromProps(props:any,state:any){
        //  
        return  {modal1Visible:props.open}
    }
 
    render() {
        
      
        return (

            <>
            {/* <Button type="primary" onClick={() => this.setModal1Visible(true)}>
              ccc 
            </Button> */}
            <Modal
              title={"区域"+this.props.sel}
              width={1000}
            //   height={1000}
              style={{ top: 20 }}
              visible={this.state.modal1Visible}
              onOk={() => this.setModal1Visible(false)}
              onCancel={() => this.setModal1Visible(false)}

              destroyOnClose={true}
              footer={null}
  
            >


            {/* destroyOnClose={true}  模态框   关闭时候销毁这个元素============ */}
            {/* destroyOnClose={true}  模态框   关闭时候销毁这个元素============ */}
            {/* destroyOnClose={true}  模态框   关闭时候销毁这个元素============ */}

              {/* <p> A区仓库</p> */}
              <Desks sleep={this.props.sel} ></Desks>
           
            </Modal>
            <br />
         
          </>
        );
    }
}

export default Desk;



